{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第一讲：方程组的几何解释\n",
    "\n",
    "我们从求解线性方程组来开始这门课，从一个普通的例子讲起：方程组有$2$个未知数，一共有$2$个方程，分别来看方程组的“行图像”和“列图像”。\n",
    "\n",
    "有方程组$\\begin{cases}2x&-y&=0\\\\-x&+2y&=3\\end{cases}$，写作矩阵形式有$\\begin{bmatrix}2&-1\\\\-1&2\\end{bmatrix}\\begin{bmatrix}x\\\\y\\end{bmatrix}=\\begin{bmatrix}0\\\\3\\end{bmatrix}$，通常我们把第一个矩阵称为系数矩阵$A$，将第二个矩阵称为向量$x$，将第三个矩阵称为向量$b$，于是线性方程组可以表示为$Ax=b$。\n",
    "\n",
    "我们来看行图像，即直角坐标系中的图像："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeYAAAFVCAYAAAA6zUwUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xtw1PX97/HXLrlnE0DIhVhNUEFQvBQcjyJeak0LhR5l\nACVcj9pT7dRWRQQtPV460rSO+vPYgY7KUaNOtRacn9VSWzmMtNX2yC8tVEVQLgEMBBJuuWez2e/5\nIxDJPfnud/d7ez5mmNbsd7PvTz7JvrJfvvsiYBiGIQAA4AhBuwcAAABfIZgBAHAQghkAAAchmAEA\ncBCCGQAAByGYAQBwkJiC+ciRI7ruuuu0Z88eq+YBAMDXTAdzJBLRww8/rLS0NCvnAQDA10wH8y9/\n+UuVlJQoNzfXynkAAPA1U8H85ptvasSIEbrqqqtEcRgAANYJmKnkXLBggQKBgCRp+/btGj16tH79\n619rxIgRvd7HMIyO+wBIjKKiIklSRUWFrXMAfmAYhv7v5n167j8/UVNLRG8/eaOpz5Nk5k6vvvpq\nx/9fuHChfvazn/UZypIUCARUXV1n5uFcIScny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ffrvvvv18zZ87sdJvZvYvLv7/41FNPKRwOa+XKlTIMQ9nZ2Vq1apVe\neuklFRYW6hvf+IYWLlyoefPmyTAMLVmyRCkpKfEYJaFOX99NN92kOXPmKDk5WTNnztS5555r93gx\n88r+lZSUaPny5Zo3b55SUlL05JNPSnL3/hUXF+uDDz7ouLajtLRU77zzjpqamjRnzhw9+OCDuu22\n22QYhubMmaPc3FybJx6c/ta3ZMmSjrMcV155Zcc1BG4UCAQkyVP7d0pPa3P73j377LOqra3V6tWr\ntWrVKgUCAd18880x7R1d2QAAOAgFIwAAOAjBDACAgxDMAAA4CMEMAICDEMwAADgIwQwAgIMQzAAA\nOMj/B7jePUnkGW/XAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x104d91a58>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "\n",
    "x = [-2, 2, -2, 2]\n",
    "y = [-4, 4, 0.5, 2.5]\n",
    "\n",
    "fig = plt.figure()\n",
    "plt.axhline(y=0, c='black')\n",
    "plt.axvline(x=0, c='black')\n",
    "\n",
    "plt.plot(x[:2], y[:2], x[2:], y[2:])\n",
    "\n",
    "plt.draw()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "plt.close(fig)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "上图是我们都很熟悉的直角坐标系中两直线相交的情况，接下来我们按列观察方程组$x\\begin{bmatrix}2\\\\-1\\end{bmatrix}+y\\begin{bmatrix}-1\\\\2\\end{bmatrix}=\\begin{bmatrix}0\\\\3\\end{bmatrix}$（我们把第一个向量称作$col_1$，第二个向量称作$col_2$，以表示第一列向量和第二列向量），要使得式子成立，需要第一个向量加上两倍的第二个向量，即$1\\begin{bmatrix}2\\\\-1\\end{bmatrix}+2\\begin{bmatrix}-1\\\\2\\end{bmatrix}=\\begin{bmatrix}0\\\\3\\end{bmatrix}$。\n",
    "\n",
    "现在来看列图像，在二维平面上画出上面的列向量："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAd8AAAFVCAYAAACuK+XmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Wl8VPX9t/HrzEwyM9kggYQAEsImgoiKyKaIRUWJ4gst\nKmsAQZG/CCJrBUFRyiKFuoAKKIJstdbe2lZpQRSVWpe2UKtVQQJhJ8RIEjIzySz3gyitCwJDcs4s\nn/cjM8kwX34czzVnJnOOEQqFQoiIiIhpbFYPICIiEm8UXxEREZMpviIiIiZTfEVEREym+IqIiJhM\n8RURETHZWcW3uLiYK6+8koKCgpqaR0REJOaFHV+/38/MmTNxuVw1OY+IiEjMCzu+8+bNY8CAAWRl\nZdXkPCIiIjEvrPi+/PLL1KtXj8suuwydIEtEROTMGOGcXnLw4MEYhgHAZ599RrNmzXjqqaeoV6/e\nSe/j9wdwOOzhTyoiZyw3NxeA3bt3WzqHiHyXI5w7rV69+sR/DxkyhFmzZv1keAFKSirCeSjLZGam\nUlRUZvUYMU/rXLuCwRA2m6E1rmXajmtfNK5xZmbqSb931h81+vYIWERERE5PWEe+/2vVqlU1MYeI\niEjc0Ek2RERETKb4ioiImEzxFRERMZniKyIiYjLFV0RExGSKr4iIiMkUXxEREZMpviIiIiZTfEVE\nREym+IqIiJhM8RURETGZ4isiImIyxVdERMRkiq+IiIjJFF8RERGTKb4iIiImU3xFRERMpviKiIiY\nTPEVERExmeIrIiJiMsVXRETEZIqviIiIyRRfERERkym+IiIiJlN8RURETKb4ioiImEzxFRERMZni\nKyIiYjLFV0RExGSKr4iIiMkUXxEREZMpviIiIiZTfEVEREym+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h8ODB5OXlWT1OjdD/jSexc+dO7r33XhYsWMDll19u9TgiZ6RDhw5s2bIF\ngG3btnHuuedaPFFs04kCa8/Ro0cZMWIEkyZN4qabbrJ6nBqjI9+TWLhwIZWVlcyePZtQKERaWpre\n25Gocc0117B169YTv7cwZ84ciyeKbYZhWD1CzHrmmWcoLS1lyZIlLF68GMMwWL58OYmJiVaPdlZ0\nbmcRERGT6WVnERERkym+IiIiJlN8RURETKb4ioiImEzxFRERMZniKyIiYjLFV0RExGT/H/bNcoNz\n8K2eAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11909a320>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from functools import partial\n",
    "\n",
    "fig = plt.figure()\n",
    "plt.axhline(y=0, c='black')\n",
    "plt.axvline(x=0, c='black')\n",
    "ax = plt.gca()\n",
    "ax.set_xlim(-2.5, 2.5)\n",
    "ax.set_ylim(-3, 4)\n",
    "\n",
    "arrow_vector = partial(plt.arrow, width=0.01, head_width=0.1, head_length=0.2, length_includes_head=True)\n",
    "\n",
    "arrow_vector(0, 0, 2, -1, color='g')\n",
    "arrow_vector(0, 0, -1, 2, color='c')\n",
    "arrow_vector(2, -1, -2, 4, color='b')\n",
    "arrow_vector(0, 0, 0, 3, width=0.05, color='r')\n",
    "\n",
    "plt.draw()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "plt.close(fig)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如图，绿向量$col_1$与蓝向量（两倍的蓝绿向量$col_2$）合成红向量$b$。\n",
    "\n",
    "接着，我们继续观察$x\\begin{bmatrix}2\\\\-1\\end{bmatrix}+y\\begin{bmatrix}-1\\\\2\\end{bmatrix}=\\begin{bmatrix}0\\\\3\\end{bmatrix}$，$col_1,col_2$的某种线性组合得到了向量$b$，那么$col_1,col_2$的所有线性组合能够得到什么结果？它们将铺满整个平面。\n",
    "\n",
    "下面进入三个未知数的方程组：$\\begin{cases}2x&-y&&=0\\\\-x&+2y&-z&=-1\\\\&-3y&+4z&=4\\end{cases}$，写作矩阵形式$A=\\begin{bmatrix}2&-1&0\\\\-1&2&-1\\\\0&-3&4\\end{bmatrix},\\ b=\\begin{bmatrix}0\\\\-1\\\\4\\end{bmatrix}$。\n",
    "\n",
    "在三维直角坐标系中，每一个方程将确定一个平面，而例子中的三个平面会相交于一点，这个点就是方程组的解。\n",
    "\n",
    "同样的，将方程组写成列向量的线性组合，观察列图像：$x\\begin{bmatrix}2\\\\-1\\\\0\\end{bmatrix}+y\\begin{bmatrix}-1\\\\2\\\\-3\\end{bmatrix}+z\\begin{bmatrix}0\\\\-1\\\\4\\end{bmatrix}=\\begin{bmatrix}0\\\\-1\\\\4\\end{bmatrix}$。易知教授特意安排的例子中最后一个列向量恰巧等于等式右边的$b$向量，所以我们需要的线性组合为$x=0,y=0,z=1$。假设我们令$b=\\begin{bmatrix}1\\\\1\\\\-3\\end{bmatrix}$，则需要的线性组合为$x=1,y=1,z=0$。\n",
    "\n",
    "我们并不能总是这么轻易的求出正确的线性组合，所以下一讲将介绍消元法——一种线性方程组的系统性解法。\n",
    "\n",
    "现在，我们需要考虑，对于任意的$b$，是否都能求解$Ax=b$？用列向量线性组合的观点阐述就是，列向量的线性组合能否覆盖整个三维向量空间？对上面这个例子，答案是肯定的，这个例子中的$A$是我们喜欢的矩阵类型，但是对另一些矩阵，答案是否定的。那么在什么情况下，三个向量的线性组合得不到$b$？\n",
    "\n",
    "——如果三个向量在同一个平面上，问题就出现了——那么他们的线性组合也一定都在这个平面上。举个例子，比如$col_3=col_1+col_2$，那么不管怎么组合，这三个向量的结果都逃不出这个平面，因此当$b$在平面内，方程组有解，而当$b$不在平面内，这三个列向量就无法构造出$b$。在后面的课程中，我们会了解到这种情形称为**奇异**、**矩阵不可逆**。\n",
    "\n",
    "下面我们推广到九维空间，每个方程有九个未知数，共九个方程，此时已经无法从坐标图像中描述问题了，但是我们依然可以从求九维列向量线性组合的角度解决问题，仍然是上面的问题，是否总能得到$b$？当然这仍取决于这九个向量，如果我们取一些并不相互独立的向量，则答案是否定的，比如取了九列但其实只相当于八列，有一列毫无贡献（这一列是前面列的某种线性组合），则会有一部分$b$无法求得。\n",
    "\n",
    "接下来介绍方程的矩阵形式$Ax=b$，这是一种乘法运算，举个例子，取$A=\\begin{bmatrix}2&5\\\\1&3\\end{bmatrix},\\ x=\\begin{bmatrix}1\\\\2\\end{bmatrix}$，来看如何计算矩阵乘以向量：\n",
    "\n",
    "* 我们依然使用列向量线性组合的方式，一次计算一列，$\\begin{bmatrix}2&5\\\\1&3\\end{bmatrix}\\begin{bmatrix}1\\\\2\\end{bmatrix}=1\\begin{bmatrix}2\\\\1\\end{bmatrix}+2\\begin{bmatrix}5\\\\3\\end{bmatrix}=\\begin{bmatrix}12\\\\7\\end{bmatrix}$\n",
    "* 另一种方法，使用向量内积，矩阵第一行向量点乘$x$向量$\\begin{bmatrix}2&5\\end{bmatrix}\\cdot\\begin{bmatrix}1&2\\end{bmatrix}^T=12,\\ \\begin{bmatrix}1&3\\end{bmatrix}\\cdot\\begin{bmatrix}1&2\\end{bmatrix}^T=7$。\n",
    "\n",
    "教授建议使用第一种方法，将$Ax$看做$A$列向量的线性组合。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
